﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GoodTrader.GTOrder
{
    public class CAccountManager
    {
        // 계좌 목록. 계좌 목록은 외부에서 필요에 따라 추가되거나 삭제된다. 
        private List<GTOrder.CAccount> m_AccountList = new List<GTOrder.CAccount>();
        public List<GTOrder.CAccount> AccountList
        {
            get { return m_AccountList; }
            set { m_AccountList = value; }
        }
        
        // GTOrder.COrderParameter a_OrderParam
        public void RequestOrder(GTOrder.COrderParameter a_OrderParam)
        {
            if (a_OrderParam == null)
                return;

            for (int i = 0; i < m_AccountList.Count; i++)
            {
                CAccount curAccount = m_AccountList[i];
                a_OrderParam.AccountNumber = curAccount.Number;
                curAccount.RequestOrder(a_OrderParam);
            }
        }
    }
}
